import uuid
import textwrap
import tornado.web

import tornado.httpserver #http服务端
import tornado.ioloop
import tornado.options #选项
import tornado.websocket


from tornado.options import define#定义,options
                        #指定的端口的登录（8000）数字类型整形
define('port',default=8000,help='run on the giver port',type=int)


#主函数tonado.web.requestHandler请求处理器
class IndexHandler(tornado.web.RequestHandler):
    def get(self):
        self.render('index.html')




if __name__ == '__main__':
    print('OK')
    tornado.options.parse_command_line()
    app=tornado.web.Application(handlers=[(r'/',IndexHandler)])
    http_server=tornado.httpserver.HTTPServer(app)
    http_server.listen(8000)
    tornado.ioloop.IOLoop.instance().start()